<h2 style="padding: 0px; height: 25px"><?php if ($this->get('Id', 0) == 0) echo 'Add '; else echo 'Edit '; ?>Module</h2>
<?php if (!empty($module)): ?>
<?php
echo XHtml::beginForm(array('/Cms/admin/modules/save'), 'post', array('id'=>'FormModuleEdit'));
XHtml::hightlightErrorFields();
?>
<div class="Input">
    <label>Name: (*)</label>
    <?php echo XHtml::encode($module->Name); ?>
    <?php echo XHtml::activeHiddenField($module, 'Name'); ?>
</div>

<div class="Input">
    <label>Title: (*)</label>
    <?php echo XHtml::activeTextField($module, 'Title'); ?>
</div>

<div class="Input">
    <label>Enabled: (*)</label>
    <div class="radio-list">
    <?php 
    $htmlOptions = array('separator' => '&nbsp;&nbsp;');
    if ($module->IsSystem) $htmlOptions['disabled'] = 'disabled';
    echo XHtml::activeRadioButtonList($module, 'Enabled', $module->getEnabledOptions(), $htmlOptions); ?>
    </div>
</div>

<div class="Input">
    <label>Description</label>
    <?php echo XHtml::activeTextArea($module, 'Description'); ?>
</div>

<div class="Input">
    <label>Author:</label>
    <?php echo XHtml::activeTextField($module, 'Author'); ?>
</div>

<div class="Input">
    <label>Version:</label>
    <?php echo XHtml::activeTextField($module, 'Version'); ?>
</div>

<div class="Input">
    <label>Home Page</label>
    <?php echo XHtml::activeTextField($module, 'Homepage'); ?>
</div>

<div class="Input">
    <label>Url for update</label>
    <?php echo XHtml::activeTextField($module, 'UpdateUrl'); ?>
</div>

<div class="Input">
    <label>TablePrefix</label>
    <?php echo XHtml::activeTextField($module, 'TablePrefix'); ?>
</div>

<div class="Action">
    <?php echo XHtml::submitButton('Save', array('name' => 'Save'))?>
    <?php echo XHtml::link('Cancel', array('/Cms/admin/modules/all')); ?>
</div>

<?php 
echo XHtml::activeHiddenField($module,'Id');
if ($module->IsSystem) {
    echo XHtml::activeHiddenField($module,'Enabled');
    echo XHtml::activeHiddenField($module,'IsSystem');
}
echo XHtml::endForm(); ?>
<?php
$cs = Yii::app()->ClientScript;
$cs->registerScriptFile(Yii::app()->theme->BaseUrl.'/scripts/common.js', CClientScript::POS_BEGIN);
?>
<?php else: ?>
<p><?php echo Yii::t('Module', 'MODULE_NOT_FOUND'); ?></p>
<?php endif; ?>